package cn.shyouchi.wuguanjia.android.ui.statistic.page;

import android.content.Intent;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.ui.statistic.SignStatisticProfileActivity;

/**
 * Created by Eenie on 2016/12/14 at 9:18
 * Email: 472279981@qq.com
 * Des:
 */

public class YearStatisticAdapter extends BaseQuickAdapter<String,BaseViewHolder> {

    String projectId;

    public YearStatisticAdapter(List<String> data, String projectId) {
        super(R.layout.item_year_statistic_layout, data);
        this.projectId = projectId;
    }

    @Override
    protected void convert(BaseViewHolder holder, final String entity) {

        holder.setText(R.id.model_date,entity);

        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, SignStatisticProfileActivity.class);
                intent.putExtra("date", entity);
                intent.putExtra("year", true);
                intent.putExtra("projectId", projectId);
                mContext.startActivity(intent);
            }
        });
    }
}
